
// 1. 定义 (路由) 组件。
// 可以从其他文件 import 进来
const home =httpVueLoader('./src/home/home.vue')
const home1 =httpVueLoader('./src/home/home1.vue')
const home2 =httpVueLoader('./src/home/home2.vue')
const shoppage =httpVueLoader('./src/shop-page/shop-page.vue')
const aboutus =httpVueLoader('./src/about-us/about-us.vue')
const shoplist =httpVueLoader('./src/shop-list/shop-list.vue')
const blogpage =httpVueLoader('./src/blog-page/blog-page.vue')
const blogdetail =httpVueLoader('./src/blog-detail/blog-detail.vue')
const cart =httpVueLoader('./src/cart/cart.vue')
const checkout =httpVueLoader('./checkout/checkout.vue')
const contact =httpVueLoader('./src/contact/contact.vue')
const login =httpVueLoader('./src/login/login.vue')
const register =httpVueLoader('./src/register/register.vue')
const wishlist =httpVueLoader('./src/wishlist/wishlist.vue')
const singleproduct =httpVueLoader('./src/single-product/single-product.vue')

// 2. 定义路由
// 每个路由应该映射一个组件。 其中"component" 可以是
// 通过 Vue.extend() 创建的组件构造器，
// 或者，只是一个组件配置对象。
// 我们晚点再讨论嵌套路由。
const routes = [
    { path: '*', component: home },
    { path: '/home', component: home },
    { path: '/home1', component: home1 },
    { path: '/home2', component: home2 },
    { path: '/shop-page', component: shoppage },
    { path: '/about-us', component: aboutus },
    { path: '/shop-list', component: shoplist },
    { path: '/blog-page', component:  blogpage },
    { path: '/blog-detail', component:  blogdetail },
    { path: '/cart', component:  cart },
    { path: '/checkout', component:  checkout },
    { path: '/contact', component:  contact },
    { path: '/login', component:  login },
    { path: '/register', component:  register },
    { path: '/wishlist', component:  wishlist },
    { path: '/single-product', component:  singleproduct },

]
export default ({
    mode: 'hash',//history hash  abstract
    routes // (缩写) 相当于 routes: routes
  })